package org.wit.ecommerce.service;

import java.util.Map;

import org.wit.ecommerce.domain.ClientUser;
import org.wit.ecommerce.domain.PartnerUser;
import org.wit.ecommerce.domain.SuperUser;
import org.wit.ecommerce.domain.User;
import org.wit.ecommerce.dto.Navigator;
/**
 * 
 * @author Justin
 *
 */
public interface IUserService {
	/**
	 * create a new user
	 * @param user
	 * @return
	 */
	void createUser(User user);
	
	/**
	 * update a user
	 * @param user
	 * @return
	 */
	void updateUser(User user);
	
	/**
	 * change a user's status
	 * @param id
	 * @param status disable or enable or approved
	 * @return
	 */
	User changeUserStatus(Long id, int status);
	
	/**
	 * change a user's passwrod
	 * @param id
	 * @param password
	 * @return
	 */
	User changeUserPassword(Long id, String password);
	
	/**
	 * delete a user
	 * @param id
	 */
	void deleteUser(Long id);
	
	/**
	 * batch delete of users
	 * @param ids
	 */
	void deleteUsers(Long[] ids);
	
	/**
	 * get users by page and criteria;
	 * note the user's status
	 * @param page
	 * @param keywords
	 * @return
	 */
	Navigator<User> getUsersByPage(int page, Map<String,?> keywords);
	
	/**
	 * login the system by email and password
	 * @param email
	 * @param password
	 * @return
	 */
	User login(String email, String password);
	
	/**
	 * get a user by id
	 * @param id
	 * @return
	 */
	User getUserById(Long id);
	
	/**
	 * get superusr by id
	 * @param id
	 * @return
	 */
	SuperUser getSuperById(Long id);
	
	/**
	 * get partneruser by id
	 * @param id
	 * @return
	 */
	PartnerUser getPartnerById(Long id);
	
	/**
	 * get client by id
	 * @param id
	 * @return
	 */
	ClientUser getClientById(Long id);
}
